package api;

import java.util.List;

import api.error.InvalidRequestException;
import api.error.UnknownResponseException;

public abstract class Interpreter {

	public abstract Command[] getCommands();
	public abstract boolean isResponseGood(String response);
	public abstract String[] getStartupCommands();
	public abstract String[] getReleaseCommands();
	public abstract List<String> interpretRequest(String command) throws InvalidRequestException;
	public abstract List<String> interpretResponse(String response);
	public Command getCommand(String name)
	{
		name = name.toLowerCase().trim();
		for(Command c : getCommands())
			if(c.getName().equals(name))
				return c;
		
		return null;
	}
}
